(function() {

    var db = {

        loadData: function(filter) {
            return $.grep(this.clients, function(client) {
                return (!filter.Name || client.Name.indexOf(filter.Name) > -1)
                    && (filter.Age === undefined || client.Age === filter.Age)
                    && (!filter.Address || client.Address.indexOf(filter.Address) > -1)
                    && (!filter.Country || client.Country === filter.Country)
                    && (filter.Married === undefined || client.Married === filter.Married);
            });
        },
        updateItem: function(updatingClient) { },

        deleteItem: function(deletingClient) {
            var clientIndex = $.inArray(deletingClient, this.clients);
            this.clients.splice(clientIndex, 1);
        }

    };

    window.db = db;

    db.clients = [
        {
            "模型名": "个人授信评估模型",
            "模型编号": "00061",
            "模型部署人":"刘明",
            "部署时间": "2017-01-22 12:21:23",
            "允许调用": false
        },
        {
            "模型名": "个人授信评估模型",
            "模型编号": "00062",
            "模型部署人":"董洁",
            "部署时间": "2017-01-22 12:21:23",
            "允许调用": false
        },
        {
            "模型名": "个人授信评估模型",
            "模型编号": "00063",
            "模型部署人":"朱越",
            "部署时间": "2017-01-22 12:21:23",
            "允许调用": false
        },
        {
            "模型名": "个人授信评估模型",
            "模型编号": "00061",
            "模型部署人":"李明凯",
            "部署时间": "2017-01-22 12:21:23",
            "允许调用": false
        },
        {
            "模型名": "个人授信评估模型",
            "模型编号": "00061",
            "模型部署人":"刘明",
            "部署时间": "2017-01-22 12:21:23",
            "允许调用": false
        },
        {
            "模型名": "个人授信评估模型",
            "模型编号":"00061",
            "模型部署人":"刘明",
            "部署时间": "2017-01-22 12:21:23",
            "允许调用": false
        },
        {
            "模型名": "个人授信评估模型",
            "模型编号": "00061",
            "模型部署人":"刘明",
            "部署时间": "2017-01-22 12:21:23",
            "允许调用": false
        },
        {
            "模型名": "企业授信评估模型",
            "模型编号": "00061",
            "模型部署人":"刘明",
            "部署时间": "2017-01-22 12:21:23",
            "允许调用": true
        },
        {
            "模型名": "企业授信评估模型",
            "模型编号": "00061",
            "模型部署人":"刘明",
            "部署时间": "2017-01-22 12:21:23",
            "允许调用": true
        },
        {
            "模型名": "企业授信评估模型",
            "模型编号": "00061",
            "模型部署人":"刘明",
            "部署时间": "2017-01-22 12:21:23",
            "允许调用": true
        },
        {
            "模型名": "企业授信评估模型",
            "模型编号": '00062',
            "模型部署人":"刘明",
            "部署时间": "2017-01-22 12:21:23",
            "允许调用": true
        },
        {
            "模型名": "企业授信评估模型",
            "模型编号": "00061",
            "模型部署人":"刘明",
            "部署时间": "2017-01-22 12:21:23",
            "允许调用": true
        },
        {
            "模型名": "个人贷款额度测评模型",
            "模型编号":  "00061",
            "模型部署人":"刘明",
            "部署时间": "2017-01-22 12:21:23",
            "允许调用": false
        }
    ];


}());